const path = require('path')
module.exports = {
  configureWebpack: {
    resolve: {
      alias: {
        components: '@/components',
        content: 'components/content',
        common: 'components/common',
        assets: '@/assets',
        network: '@/network',
        views: '@/views',
        utils: '@/utils'
      }
    }
  },
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: [
        // 这个是加上自己的路径，
        // 注意：试过不能使用别名路径
        path.resolve(__dirname, './src/assets/css/base.less')
      ]
    }
  },
  devServer: {
    proxy: {
      '/api': {
        target: 'http://localhost:8080',
        changeOrigin: true, // 设置这个参数可以避免跨域
        pathRewrite: {
          '^/api': '/mock'
        }
      }
    }
  }
}
